<? $urlOptions = array ('module' => 'admin', 'controller' => 'role', 'action' => 'add'); ?>
<form id="role" action="<?= $this->url($urlOptions) ?>" onSubmit="return saveRow(this)" method="post">
<table id="roleList" class="toonStatList" cellspacing="0" cellpadding="3">
   <thead>
      <tr>
         <th valign="middle" colspan="2">Class Roles</th>
      </tr>
   </thead>
   <tbody>
      <tr>
         <td valign="middle"><?= $this->formText('role_name', 'Add Role', array('size' => 20, 'onfocus' => "check_focus(this, 'Add Role')", 'onblur' => "check_blur(this, 'Add Role')")); ?></td>
         <td width="20px"><?= $this->formSubmit('submit', '+'); ?></td>
      </tr>
<? $i = 0;
$optionsCopy = $urlOptions; 
$optionsCopy['controller'] = 'confirm';
$optionsCopy['action'] = 'deleterow';
$optionsCopy['c'] = 'role';
foreach ( $this->roles as $row ): 
      $optionsCopy['i'] = $row['id'] ?>
      <tr id="role_<?= $row['id'] ?>" class="<?= $i++ % 2 ? 'even' : 'odd' ?>">
         <td valign="middle" height="20px"><?= $row['name'] ?></td>
         <td style="text-align: center">
            <a href="<?= $this->url($optionsCopy)?>" onClick="return deleteRow('role','<?=$row['id']?>');"><img 
               id="role_<?=$row['id']?>_img" src="/tools/images/delete_16.png" border="0" height="16" width="16" /></a>
         </td>
      </tr>
<? endforeach; ?>
   </tbody>
</table>
</form>
